﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Sunny.UI;

namespace whu2020302051098 {
    public partial class MainWindowcs : Form {


        void ChangeStyle(UILabel label)
        {
            label.MouseHover += (sender, args) => {
                label.ForeColor = Color.Aqua;
                label.BorderStyle = BorderStyle.FixedSingle;
            };
            label.MouseLeave += (sender, args) => {
                label.ForeColor = Color.White;
                label.BorderStyle = BorderStyle.None;
            };
        }


        public MainWindowcs() {
            InitializeComponent();
            this.BackgroundImage = Properties.Resources.whu;
            this.BackgroundImageLayout = ImageLayout.Zoom;
            ChangeStyle(this.continueBtn);
            ChangeStyle(this.quitBtn);
            


        }

        private void continueBtn_Click(object sender, EventArgs e)
        {
            if (userName.Text == "root" && password.Text == "root")
            {
                FunctionWindow function = new FunctionWindow("root");
                function.Show();
                this.Hide();
            }
            else
            {
                Form1 form = new Form1();
                form.Show();
                this.Hide();
            }
        }

        private void quitBtn_Click(object sender, EventArgs e) {
            this.Close();
        }

    }
}
